#!/usr/bin/env bash

if [ $# -lt 1 ]; then
    echo -e "
Usage:
    dci [image name keyword]
"
    exit 1
fi

if [ $# = 0 ]; then
    docker images | awk '{print $3}' | grep -v 'IMAGE' | xargs docker rmi -f
else
    docker images | grep $1 | awk '{print $3}' | grep -v 'IMAGE' | xargs docker rmi -f
fi